﻿#if UNITY_WECHAT_GAME
using WeChatWASM;
#endif

namespace HBFramework
{
    public class VibrationManager : Singleton<VibrationManager>, ISingleton
    {
        public bool OpenVibrate = true;

        public void OnInit()
        {
#if UNITY_WECHAT_GAME
            //不需要初始化
#else
            Vibration.Init();
#endif
        }

        public void OnDestroy()
        {

        }

        public void VibratePop()
        {
            if (!OpenVibrate) return;

#if UNITY_WECHAT_GAME
            VibrateShortOption option = new VibrateShortOption();
            option.type = "medium";
            WX.VibrateShort(option);
#else
            Vibration.VibratePop();
#endif
        }
    }
}